package CfengMiddleWare.model.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 发红包记录
 * </p>
 *
 * @author cfeng
 * @since 2022-09-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class RedRecord extends Model<RedRecord> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 红包全局唯一标识串
     */
    private String redPacket;

    /**
     * 人数
     */
    private Integer total;

    /**
     * 总金额（单位为分）
     */
    private BigDecimal amount;

    private Integer isActive;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
